import {useEffect,useState} from 'react'
import $http from '@/api'
import {ICompany} from '@/utils/type'
const Compnay:React.FC=()=>{
    const[list,setList]=useState([])
    const getCompnay=async()=>{
        let {data}=await $http.company.getCompany()   
        setList(data)   
    }
    useEffect(()=>{
        getCompnay()
    },[])
    return(
        <>
            <h2>公司列表</h2>
            <ul>
                {
                    list.map((item:ICompany)=><li key={item.id}>
                        {item.name}
                    </li>)
                }
            </ul>
           
        </>
    )
}
export default Compnay